#include <stdio.h>
#include <iostream>
#include <sstream>
//
//template <typename ...Args>
//void myprint(std::ostringstream& os, Args&&... args) {
    //myprint(os, std::forward<Args>(args))
//}

void myprint_imp(std::ostringstream& os) {}

template <typename T, typename ...Args>
void myprint_imp(std::ostringstream& os, T&& first, Args&&... args) {
    oss << std::forward<T>(first);
    myprint_imp(os, std::forward<Args>(args)...);
}

template <typename ...Args>
std::string myprint(Args&&... args) {
    std::ostringstream os;
    myprint_imp(os, std::forward<Args>(args)...);
    return os.str();
}

int main(int argc, const char **argv) {
    std::cout << myprint("hello", " ", 1, 3, "xx" , 5.6) << std::endl;
    return 0;
}
